# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-atpublic
pkgver=5.0
pkgrel=0
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=atpublic
pkgdesc="@public decorator for Python"
url="https://gitlab.com/warsaw/public"
arch="noarch"
license="Apache-2.0"
checkdepends="
	py3-pytest-cov
	py3-sybil
"
makedepends="
	py3-setuptools
	py3-hatchling
	py3-gpep517
	py3-wheel
"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://gitlab.com/warsaw/public/-/archive/$pkgver/public-$pkgver.tar.gz"
builddir="$srcdir/public-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer "$builddir"/.dist/*.whl
	.testenv/bin/python3 -m pytest -v
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
f05b955f84c1907f925c78cd44d00186dd0858d1fef3b9bbeec3a3a40b28c48c1b0900f1d00ab078b738493dbf72f706cdfaafad7b041b78f88d0ed7d564d024  py3-atpublic-5.0.tar.gz
"
